<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<div id="d1" style="display: inline-block">呵呵</div>
<script>
    window.onload = function () {
        let text = document.getElementById('d1');
        text.innerHTML = '当前时间：' + new Date().toLocaleString();
        //反复定时器
        setInterval(function () {
            text.innerHTML = '当前时间：' + new Date().toLocaleString();
        },1000)
    }
</script>
</body>
</html>